package com.qianf.qfoffice.controller;

import com.qianf.qfoffice.entity.ResponseData;
import com.qianf.qfoffice.entity.ShowExercise;
import com.qianf.qfoffice.service.ShowExerciseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody
public class ShowExerciseController {

    @Autowired
    private ShowExerciseService showExerciseService;

    /**
     * 环状图路径
     * @return
     */
    @RequestMapping("/showExercise.do")
    public ResponseData<ShowExercise> showExercise(){

        ResponseData<ShowExercise> responseData = new ResponseData<>();

        try{
            ShowExercise showExercise = showExerciseService.selectExerciseList();
            responseData.setCode(0);
            responseData.setData(showExercise);
        }catch (Exception e){
            responseData.setCode(1);
            responseData.setMsg("服务异常");
        }

        return responseData;

    }
}
